﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace YemekteyizLib.Bs
{
    public class Tools
    {
        private static SqlConnection con = new SqlConnection("server=.;Database=yemekteyiz;Integrated Security=true;MultipleActiveResultSets=True");

        public static SqlConnection GetConnection()
        {
            if (con.State != System.Data.ConnectionState.Open)
            {
                con.Open();
            }

            return con;
            
        
        }

        public static void CloseConnection()
        {
            if (con.State != System.Data.ConnectionState.Closed)
            {
                con.Close();
            }   
        }

    }
}
